(define tolerance 0.00001)


(define (iterative-improve f improve)
    (lambda (x y) 
        (if (f x y) 
            x
            ((iterative-improve f improve) (improve x y) y)
        )
    )
)
(define f
    (lambda (x y) 
        (< (abs (- (* x x) y)) tolerance)
    )
)
(define improve
    (lambda (x y)
        (display "x=")
        (display x)
        (newline) 
        (/ (+ 
                (/ y x)
                x
            )
            2 
        )
    )
)
(display ((iterative-improve f improve) 1.0 2))
(exit)